package com.iz0000.exp.ssmeh.service.impl;

import com.iz0000.exp.ssmeh.bean.User;
import com.iz0000.exp.ssmeh.dao.UserMapper;
import com.iz0000.exp.ssmeh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: guoxl
 * @Date: 2019/4/7 20:27
 * @Description:
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    @Cacheable(value = "user")
    public List<User> queryAllUsers() throws Exception {
        Thread.sleep(10000);
        return userMapper.queryAllUsers();
    }
}
